<?php
    /**
     * User zgh
     * Email 1803897171@qq.com
     * Date 2021/7/22
     **/

    namespace app\admin\controller;

    use app\common\Annotation\ControllerAnnotation;
    use app\common\Annotation\NodeAnotation;
    use app\common\controller\BackendController;
    use app\common\service\SysConfigService;
    use think\facade\Request;

    /**
     * @ControllerAnnotation(title="系统配置",auth=2)
     * Class SysconfigController
     * @package app\admin\controller
     */
    class SysconfigController extends BackendController
    {

        /**
         * @NodeAnotation(title="列表")
         */
        public function index()
        {
            $model = SysConfigService::getByID();
            $this->assign("model", $model);
            return $this->fetch();
        }

        /**
         * @NodeAnotation(title="保存")
         */
        public function save()
        {
            if (Request::isAjax()) {
                return SysConfigService::save(Request::param()) ? success_json_response("保存成功") : json_response("保存失败");
            }
        }


    }